﻿using System;
using System.Windows.Forms;
using DCIMAP.GANS.Basic;
using DCIMAP.GANS.GeneticAlgorithms;
using DCIMAP.GANS.GeneticAlgorithms.Kit;
using DCIMAP.GANS.GeneticAlgorithms.Legacy;
/* Генетический алгоритм находит закономерности в последовательности целых чисел
 * Авторы: Балукова Елена , Ефимова Наталья , Логинов Николай. 
 * */

namespace GAIQ
{

    public class Program
    {
        public static void Main()
        {
            int[] sequence = IQTest.getTest();
            
            GeneticAlgorithm algorithm = new GeneticAlgorithm();

            MinimalGeneratorFamily generator = new MinimalGeneratorFamily(10);
            generator.Generator = new TreeGenerator();
            algorithm.GeneratorFamily = generator;

            algorithm.BufferEvaluator = new SyncronousBufferEvaluator();
            algorithm.BufferEvaluator.GeneEvaluator = new IQEvaluator(sequence);

            algorithm.MutantFamily = new MutantFamily();
            algorithm.MutantFamily.MutantCount = new ConstantCountProvider(1);
            IQMutator mutator = new IQMutator();
            mutator.MutationsCount = new ConstantCountProvider(1);
            algorithm.MutantFamily.Mutator = mutator;

            algorithm.Procurer = new RouletteProcurer(1);
            algorithm.CrossFamily = new CrossFamily();
            algorithm.CrossFamily.ChildCount = new ConstantCountProvider(1);
            algorithm.CrossFamily.Crosser = new IQCrosser();

            algorithm.Cleaner = new ThresholdCleaner(100);

            GeneticAlgorithmDriver driver = new GeneticAlgorithmDriver();
            driver.StartInfo.SystemInfo.System = algorithm;
            driver.StartInfo.SystemInfo.EnableAutosaving = false;
            driver.StartInfo.EnableLog = false;
            driver.StartInfo.InputParameters = false;
            driver.OutputPanel = new IQOutputPanel(sequence);

            driver.RunAsApplication();

        }
    }
}
